package com.itheima.内部类.test6_6;

public class Test {
    public static void main(String[] args) {
    method(new Swim() {
        @Override
        public void Swimming() {
            System.out.println("铁汁，我们去游泳吧~");
        }
    });

    }

    //2.定义方法
    //形参是接口类型时，未来实参要给该接口的实现类对象
    public static void method(Swim swim){
        /*
        Swim swim= new Swim(){
        public void Swimming(){
          System.out.println("铁汁，我们去游泳吧~");
            }
          }
          */
       swim.Swimming();
    }

}


//1.定义接口
interface Swim{
    void Swimming();
}